package sdau.computer;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

@RunWith(Parameterized.class)
public class MyTestParam3 {

    DemoJUnit demo = new DemoJUnit();

  private int num1;
  private int num2;
  private int expected;

  public MyTestParam3(int num1, int num2, int expected) {
    this.num1 = num1;
    this.num2 = num2;
    this.expected = expected;
  }


  @Parameters
  public static Collection<Object[]> testData() {
    return Arrays.asList(new Object[][] {
        { 2, 1, 2 },
        { -1, 1, -1 },
        { 0, 5, 0 },
        { 100, -100, -1},
        {100,10,10}
    });
  }

  @Test
  public void testSum() {
    assertEquals(expected, demo.chu(num1, num2));
    }
}
